import cs.asiainfo.config.service.CardService;
import cs.asiainfo.config.service.MemberService;
import cs.asiainfo.config.service.impl.CardServiceImpl;
import cs.asiainfo.config.service.impl.MemberServiceImpl;

import java.util.Scanner;

/**
 * Created by many on 2016/8/9.
 * @author many
 */
public class Main {

    private final static MemberService memberService = new MemberServiceImpl();
    private final static CardService cardService = new CardServiceImpl();

    public static void main(String[] args) throws Exception{
        String message = "";

        Scanner scanner = new Scanner(System.in);
        while(true){
            String operation = scanner.next();
            if (operation.equals("exit")){
                System.exit(1);
            }

            if (operation.equals("add-member")){
                String memberName = scanner.next();
                String memberAddress = scanner.next();
                String memberPro = scanner.next();

                message = memberService.createMember(memberName, memberAddress, memberPro);
            }
            else if (operation.equals("add-card")){
                String memberName = scanner.next();
                String cardType = scanner.next();

                message = cardService.createCard(cardType, memberName);
            }
            else {
                message = "输入有误！";
            }

            System.out.println(message);
        }
    }
}
